<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script>
      //访问历史个数
      console.log('访问历史个数:' + history.length)
    </script>
  </head>
  <body>
    <a href="1.html">1.html</a>
    <a href="2.html">2.html</a>
    <a href="3.html">3.html</a>

    <a href="javaScript:history.go(1)">前进1</a>
    <a href="javaScript:history.forward()">前进2</a>
    <a href="javaScript:history.go(-1)">后退1</a>
    <a href="javaScript:history.back()">后退2</a>
  </body>
</html>
